package com.ddtech.business.room.controller;

import com.ddtech.annotation.AnonymousAccess;
import com.ddtech.business.room.entity.RoomUser;
import com.ddtech.business.room.service.RoomUserService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @version v1.0
 * @ClassName:RoomUserController description：
 * @author:wei_zhang(xiao)
 * @date: 2024-11-18 22:22
 */
@Api(tags = "业务-房间用户管理")
@RestController
@RequestMapping("/room-user")
public class RoomUserController {

    @Autowired
    private RoomUserService roomUserService;

    @PostMapping("/joinRoom")
    @AnonymousAccess
    public ResponseEntity joinRoom(@RequestBody RoomUser roomUser, HttpServletRequest request) {
        roomUserService.joinRoom(roomUser);
        return new ResponseEntity(true, HttpStatus.OK);
    }

}
